package cn.edu.nju.software.zp13.core2.annotation;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

@Target({ ElementType.FIELD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Element{
	/**
	 * tagName of an element
	 * 
	 * @return tagName
	 */
	public String tagName() default "";

	/**
	 * This attr is aimed to add a new tagName for those complex Elements which
	 * consist of an element array.
	 * For example:
	 * 
	 * example1:
	 * 
	 * @Element()
	 * private Student[] students;
	 * 
	 * xml:(first create a new element "<students></students>" then 
	 * 		create subElements "<student></student>")
	 * <students>
	 * 	<student></student>
	 * 	<student></student>
	 * </students>
	 * 
	 * example2:
	 * 
	 * @Element(hasExtraTag=HasTag.no)
	 * private Student[] students;
	 * 
	 * xml:(create several element "<student>" directly)
	 * <student></student>
	 * <student></student>
	 * 
	 * @return	a new father tag
	 */
	public HasTag hasExtraTag() default HasTag.yes;
}
